<article id="mainContain" class="wrapper">
	<section class="floatLeft" id="lastestPost">
		<div id="newItem-1" class="lastItems catHead">
			<h1># <?php the_author(); ?> </h1>
			<p>Có tất cả <?php echo count_user_posts(get_the_author_meta('ID')); ?> bài viết bởi #<?php the_author(); ?> , nếu bạn không tìm thấy bài viết mình cần có thể <a href="" class="bold">gửi thư yêu cầu</a> cho chúng tôi. Chúng tôi sẽ nghiên cứu và viết bài mới theo yêu cầu của bạn.</p>
		</div>
		<?php if(have_posts()) : while(have_posts()) : the_post(); ?>
		<?php $categories = get_the_category(get_the_ID()); ?>
		<?php $comments = get_comments_number(get_the_ID()) > 1 ? get_comments_number(get_the_ID())." comments" : get_comments_number(get_the_ID())." comment"; ?>
			<div id="newItem-<?php echo get_the_ID(); ?>" class="lastItems">
				<div class="postImg floatLeft">
					<a href="<?php the_permalink(); ?>">
						<?php if(has_post_thumbnail(get_the_ID())) : ?>
							<?php $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()),'full'); ?>
							<img src="<?php echo CORE_TIMTHUMB_URL.$thumb[0]."&w=215";?>" alt="<?php the_title(); ?>">
					<?php else : ?>
						<?php $thumbMeta = get_post_meta(get_the_ID(), 'thumbnail', true); ?>
						<?php if(!empty($thumbMeta)) : ?>
							<img src="<?php echo CORE_TIMTHUMB_URL.get_post_meta(get_the_ID(), 'thumbnail', true)."&w=215";?>" alt="<?php the_title(); ?>">
						<?php else : ?>
						<img src="<?php echo CORE_TIMTHUMB_URL.CORE_THEME_IMAGE."no-image.jpg&w=215&h=150";?>" alt="<?php the_title(); ?>">
						<?php endif; ?>
					<?php endif; ?>
					</a>
					<div class="tag">
						<?php foreach($categories as $category) : ?>
							<a href="<?php echo get_category_link($category->term_id); ?>">#<?php echo $category->name; ?></a>
						<?php endforeach; ?>
					</div>
					<!-- /.tag -->
				</div>
				<!-- /.postImg -->
				<div class="postDescription floatRight">
					<h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
					<ul>
						<li class="author"><a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>"><?php the_author(); ?></a></li>
						<li class="time"><?php the_date('d/m/Y'); ?></li>
						<li class="comments"><a href="<?php the_permalink(); ?>#disqus_thread"><?php echo $comments; ?></a></li>
					</ul>
					<p><?php the_excerpt(); ?></p>
				</div>
				<!-- /.postDescription -->
				<div class="clearfix"></div>
			</div>
			<!-- /.lastItems -->
		<?php endwhile; endif; ?>
		<?php wp_reset_query(); ?>
		<?php wp_pagenavi(); ?>
	</section>
	<!-- /#lastestPost.floatLeft -->
	<?php $this->sidebar(); ?>
	<div class="clearfix"></div>
</article>
<!-- /#mainContent.wrapper -->